//
//  HttpServer.h
//  Fangmm
//
//  Created by 阮琦 on 16/3/5.
//  Copyright © 2016年 com.fangmm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "House.h"
#import "Requirement.h"
@interface HttpServer : NSObject
/*!
 * @abstract get house list(获取房源列表)
 * @param params dictionary must contains keys called "app" and "cityCode"
 */
+ (void)getHousesWithParams:(NSDictionary *)params WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get house detail(获取房源详情)
 * @param houseId is the only identifier of a house object
*/
+ (void)getHouseDetailWithHouseId:(NSString *)houseId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get house teams(获取室友小组)
 * @param houseId is the only identifier of a house object
 */
+ (void)getHouseTeamsWithHouseId:(NSString *)houseId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get house favorites(获取房源关注详情)
 * @param houseId is the only identifier of a house object
 * @param params contains four keys:userId, page, pageSize, app;
 */
+ (void)getHouseFavoritesWithHouseId:(NSString *)houseId withParams:(NSDictionary *)params WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get house community detail message(获取小区详情)
 * @param communityId is the only identifier of a community object
 * @param params contains two keys:communityId, app;
 */
+(void)getCommunityWithCommunityID:(NSString*)communityID withSuccessBlock:(void (^)(NSDictionary*))successBlock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get surrounging community message(获取周边小区)
 * @param communityId is the only identifier of a community object
 * @param params contains two keys:communityId, app;
 */
+(void)getSourroundingCommunityWithCommunityID:(NSString *)communityID withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to favor a house(关注房源)
 * @param houseId is the only identifier of a house object
 * @param params contains four keys:userId, page, pageSize, app;
 */
+ (void)postToFavorHouseWithHouseId:(NSString *)houseId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to delete a favorite house(取消关注房源)
 * @param favoriteId is the identifier for a house which one user's favorites
 */
+ (void)deleteFavoriteHouseWithId:(NSString *)favoriteId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get user requirements(获取需求详情)
*/
+ (void)getUserRequirementsWithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;

+ (void)getRequirementsStatistics:(Requirement *)requirement WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get focused Houses(获取关注房源)
 */
+ (void)getFocusedHousesSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get Open Areas(获取开通区域)
 */
+ (void)getOpenAreaWithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*
 用户小组列表
 */
+(void)getRoomMateTeamWithUserId:(NSString*)userID withPage:(int)page withPageSize:(int)pageSize withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*
 Post house with house object(发布房源)
 */
+(void)PostHouseWithHouse:(House*)house WithSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))failBlock;
/*
 小组行程
 */
+(void)getScheduleWithSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))failedBlock;
/*!
 * @abstract post to join a team(加入室友小组)
 * @param teamId is the only identifier for a team;
 * @param seatId is the identifier for the room you have chosen;
 */
+ (void)postToJoinTeam:(NSString *)teamId WithSeatId:(NSString *)seatId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get user detail(获取用户详情)
 * @param userId is the only identifier for a usre
 */
+ (void)getPersonDetailWithId:(NSString *)Id WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post a avatar(上传头像)
 * @param imageData
 */
+ (void)postAvatarImageWith:(NSData *)imageData WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract put user infos(修改用户信息)
 * @param params(用户信息数组)
 */
+ (void)putUserInfoWithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;

+ (void)getTeamTipsWithHouseId:(NSString *)houseId withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*!
 * @abstract post to get vcode(获取绑定手机验证码)
 * @param mobile(需绑定的手机号)
 */
+ (void)postToGetVcodeWithMobile:(NSString *)mobile WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*
 上传图片
 */
+(void)upLoadHousePhotoWithDataArray:(NSArray*)dataArray withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*
 申请列表
 */
+(void)getApplicationListWithTeamId:(NSString *)teamId withPage:(int)page withPageSize:(int)pageSize withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*
 通过申请
 */
+(void)passApplyWithTeamId:(NSString *)teamId WithApply:(NSString *)applyId withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*
 拒决申请
 */
+(void)rejectApplyWithTeamId:(NSString *)teamId WithApply:(NSString *)applyId withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;

/*!
 * @abstract get user room mate team(获取用户小组)
 */
+ (void)getRoomMateTeamWithUserId:(NSString*)userId withStatus:(NSString *)status withPage:(int)page withPageSize:(int)pageSize withUserInfo:(NSDictionary *)userInfo withSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;

/*!
 * @abstract get Wechat auth access_code(获取微信access_code)
 */
+ (void)getWXcodeWithCode:(NSString *)code WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get Wechat User data(获取微信用户数据)
 */
+ (void)getWXUserWithOpenId:(NSString *)openId andAccessToken:(NSString *)accessToken WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to login with auth(获取绑定手机验证码)
 */
+ (void)postToAuthLoginWithOpenId:(NSString *)openId andAccessToken:(NSString *)accessToken WithWechatUserData:(id)user WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to get new register vcode(获取注册手机验证码)
 */
+ (void)postToGetNewRegisterVcodeWithMobile:(NSString *)mobile WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to login with mobile(手机登录)
 */
+ (void)postToLoginWithMobile:(NSString *)mobile Vcode:(NSString *)vcode AndOauthId:(NSString *)oauthId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to submit requirement(提交需求)
 */
+ (void)postToSubmitRequirementWithParas:(NSDictionary *)params WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to modify requirement(提交需求)
 */
+ (void)putRequirementWithParas:(NSDictionary *)params WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract post to create Team(创建小组)
 */
+ (void)postToCreateTeamWithHouseId:(NSString *)houseId AndOffers:(NSString *)offers WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get Team detail(获取小组详情)
 */
+ (void)getTeamWithId:(NSString *)teamId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get ads(获取广告)
 */
+ (void)getAdsWithType:(NSString *)type WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*
 账户接口
 */
+(void)getAccountMssageWithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*设置支付密码*/
+(void)setPayKeyWithKey:(NSString *)key WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*提现申请*/
+(void)applyDrawCashWithMoney:(NSInteger)money withPassword:(NSString*)password WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*充值*/
+(void)inpoursWithMoney:(NSInteger)money WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*意向金消费*/
+(void)payEarnestWithMoney:(int)money withScheduleId:(NSString *)scheduleId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*保证金消费*/
+(void)payTrusteesWithSchedule:(NSString*)scheduleId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*!
 * @abstract get balance(获取账户)
 */
+(void)getBalanceWithSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;

+ (void)postToLoginWithMobile:(NSString *)mobile Vcode:(NSString *)vcode  WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;

+ (void)getSharelinksWithType:(NSString *)type sharedInfo:(NSString *)sharedInfo WithSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;

+ (void)getRecommendWithSuccessBlock:(void(^)(NSDictionary*))successBlock withFailedBlock:(void(^)(id))errorBlock;
/*阿里WAP支付*/
+(void)aliWapPayWithOutTradeNo:(NSString *)outTradeNo WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*获取保证金*/
+(void)getTrusteesWithScheduleId:(NSString *)scheduleId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*获取意向金*/
+(void)getEarnestsWithScheduleId:(NSString *)scheduleId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;
/*获取申请状态*/
+(void)getApplyStateWithUserId:(NSString *)userId WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failBlock;

+ (void)getPoisWithKeyword:(NSString *)keyword WithSuccessBlock:(void(^)(NSDictionary*))successblock withFailBlock:(void(^)(id))failblock;
@end
